package lcr;

public class Test0068 {
}

class Solution0068_1 {
    public int searchInsert(int[] nums, int target) {
        int left = 0, right = nums.length;
        while (left < right) {
            int mid=(left+right)>>1;
            int num = nums[mid];
            if (num == target){
                return mid;
            } else if (num > target) {
                right = mid;
            }else {
                left = mid + 1;
            }
        }
        return left;
    }
}
